<!--<script src="../../../vueblog-vue/src/router/index.js"></script>-->
<template>
  <div class="kehuan">

    <el-container>
      <el-header>
        header
      </el-header>
      <div style="margin-top: 10px" v-for="article in articles">
        <router-link :to="article.bookUrl">
          {{article.bookName}}
        </router-link>
      </div>
    </el-container>

    <el-pagination class="mpage"
                   background
                   layout="prev, pager, next"
                   :current-page="currentPage"
                   :page-size="pageSize"
                   :total="total"
                   @current-change=page>
    </el-pagination>
  </div>
</template>

<script>

export default {
  name: 'Kehuan.vue',
  data() {
    return {
      articles: {},
      currentPage: 1,
      total: 0,
      pageSize: 5
    }
  },
  methods: {
    page(currentPage) {
      const _this = this
      _this.$axios.get("/article/list?currentPage=" + currentPage).then(res => {
        console.log(res)
        _this.articles = res.data.data.records
        _this.currentPage = res.data.data.current
        _this.total = res.data.data.total
        _this.pageSize = res.data.data.size

      })
    }
  },
  created() {
    this.page(1)
  }
}

</script>


<style>
.el-header, .el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  /*background-color: #E9EEF3;*/
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.el-table-column{
margin-left: 50%;
}
.el-link {
  margin-top: 10px;
  margin-left: 20px;
}
</style>